/*
 * Copyright (C) 2016  Nicola Spanti (RyDroid) <dev@nicola-spanti.info>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */


/**
 * @file
 * @brief Generic structs and functions to draw a game.
 */


#ifndef PLANET_WARS_2D_RT_CORE_VIEW_DRAW_GENERIC_GAME_H
#define PLANET_WARS_2D_RT_CORE_VIEW_DRAW_GENERIC_GAME_H


#include "PlanetWars2dRT-core/specific/model/game_essential.h"
#include <stdio.h>


EXTERN_C_BEGIN


typedef bool (*generic_draw_planet_function)(const planet_t* a_planet,
					     const void*     extra_data);

typedef bool (*generic_draw_ship_function)(const ship_t* a_ship,
					   const void*   extra_data);

struct generic_draw_game_extra_data
{
  void* planets;
  void* ships;
  void* black_holes;
  void* wormholes;
  void* supernovas;
};
typedef struct generic_draw_game_extra_data generic_draw_game_extra_data;

struct generic_draw_game_functions
{
  generic_draw_planet_function planet;
  generic_draw_ship_function   ship;
};
typedef struct generic_draw_game_functions generic_draw_game_functions;


bool
generic_draw_planets_of_game(const game_t*                a_game,
			     generic_draw_planet_function draw_planet,
			     const void*                  extra_data,
			     bool                         stop_on_error);

bool
generic_draw_ships_of_game(const game_t*              a_game,
			   generic_draw_ship_function draw_ship,
			   const void*                extra_data,
			   bool                       stop_on_error);

bool
generic_draw_game(const game_t*                       a_game,
		  const generic_draw_game_functions*  functions,
		  const generic_draw_game_extra_data* extra_data,
		  bool                                stop_on_error);


EXTERN_C_END


#endif
